<?php
require('./public/header.php');
if(isset($_COOKIE['username'])){
    @$res1=select2($con,'user','where `username`="'.$_COOKIE['username'].'"')[0];  
    $res4=select($con,'wenzhang','where `uid` = "'.$res1['id'].'"');
}else{
    echo "<script>alert('请先登录');window.location.href='/index.php'</script>";
}
$style="float:right;background:url('./images/3.jpg');border:none;border-radius:5px;color:black;width:100px;height:50px;font-size:20px";
?>
    <div class="featured container">
    </div>
    <!-- Header -->
    
    <!-- /////////////////////////////////////////Content -->
    <div id="page-content" class="archive-page container">
        <div class="">
            <div class="row">
                <div id="main-content" class="col-md-8">
                <?php
                foreach($res4 as $v){
                    echo '<div class="box">
                        <a href="#"><h2 class="vid-name">'.$v['title'].'</h2></a>
                        <div class="info">
                            <h5>作者 <a href="#"></a></h5>
                            <span><i class="fa fa-calendar"></i>;'.date('Y-m-d H:i:s',$v['ctime']).'</span> 
                            <span><i class="fa fa-comment"></i> 0 评论</span>
                            <span><i class="fa fa-heart"></i>1,200</span>
                            <ul class="list-inline">
                                <li><a href="#">评分</a></li>
                                <li> - </li>
                                <li>
                                    <span class="rating">
                                        <i class="fa fa-star"></i>
                                        <i class="fa fa-star"></i>
                                        <i class="fa fa-star"></i>
                                        <i class="fa fa-star"></i>
                                        <i class="fa fa-star-half-o"></i>
                                    </span>
                                </li>
                            </ul>
                        </div>
                        <div class="wrap-vid">
                            <div class="zoom-container">
                                <div class="zoom-caption">
                                </div>
                                <img src="images/'.rand(1,9).'.jpg" />
                            </div>
                            <p>'.substr($v['content'],0,500).'<a href="article.php?aid='.$v['id'].'">MORE...</a></p>
                            
                        </div><button style="'.$style.'"><a href="/home/wenzhang/delete.php?sid='.$v['id'].'">删除</a></button>
                    </div>
                    <hr class="line">';
                }
                ?>
                                        
                    <div class="box">
                        <center>
                        <ul class="pagination">
                            <li><a href="/home/myarchive.php?page=1">首页</a></li>
                            <li>
                              <a href="/home/myarchive.php?page=<?php echo $_SESSION['shang'] ?>" aria-label="Previous">
                                <span aria-hidden="true">上一页</span>
                              </a>
                            </li>

                            <li><a>第<?php echo $_SESSION['page']; echo '/';echo $_SESSION['zongye'] ?>页</a></li>

                            <li>
                              <a href="/home/myarchive.php?page=<?php echo $_SESSION['xia'] ?>" aria-label="Next">
                                <span aria-hidden="true">下一页</span>
                              </a>
                            </li>
                            <li><a href="/home/myarchive.php?page=<?php echo $_SESSION['zongye'] ?>">尾页</a></li>
                        </ul>
                    </center>
                    </div>
                </div>
                <div id="sidebar" class="col-md-4">
                    <!---- Start Widget ---->

                    <!---- Start Widget ---->
                    <div class="widget wid-post">
                        <div class="heading"><h4>音乐欣赏</h4></div>
                        <div class="content">
                            <div class="post wrap-vid">
                                <div class="zoom-container">
                                    <div class="zoom-caption">
                                        <span class="youtube">浪里个浪</span>
                                        <a href="https://y.qq.com/n/yqq/song/001UMfxJ1WsCPY.html">
                                            <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
                                        </a>
                                        <p>我们都一样</p>
                                    </div>
                                    <img src="images/1.jpg" />
                                </div>
                                <div class="wrapper">
                                    <h5 class="vid-name"><a href="#">我们都一样</a></h5>
                                    <div class="info">
                                        <h6>By <a href="https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=song&w=%E5%BC%A0%E6%9D%B0">张杰</a></h6>
                                        <span><i class="fa fa-calendar"></i>25/3/2015</span> 
                                        <span><i class="fa fa-heart"></i>1,200</span>
                                    </div>
                                </div>
                            </div>
                            <div class="post wrap-vid">
                                <div class="zoom-container">
                                            <div class="zoom-caption">
                                                <span class="vimeo">JJ</span>
                                                <a href="https://y.qq.com/n/yqq/song/002ASCKm3ROw7t.html">
                                                    <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
                                                </a>
                                                <p>美人鱼</p>
                                            </div>
                                            <img src="images/2.jpg" />
                                        </div>
                                <div class="wrapper">
                                    <h5 class="vid-name"><a href="#">美人鱼</a></h5>
                                    <div class="info">
                                        <h6>By <a href="https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=song&w=%E6%9E%97%E4%BF%8A%E6%9D%B0">林俊杰</a></h6>
                                        <span><i class="fa fa-calendar"></i>31/5/2017</span> 
                                        <span><i class="fa fa-heart"></i>1,200</span>
                                    </div>
                                </div>
                            </div>
                            <div class="post wrap-vid">
                                <div class="zoom-container">
                                    <div class="zoom-caption">
                                        <span class="youtube">Jack chou</span>
                                        <a href="https://y.qq.com/n/yqq/song/002hXDfk0LX9KO.html">
                                            <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
                                        </a>
                                        <p>听妈妈的话</p>
                                    </div>
                                    <img src="images/3.jpg" />
                                </div>
                                <div class="wrapper">
                                    <h5 class="vid-name"><a href="#">听妈妈的话</a></h5>
                                    <div class="info">
                                        <h6>By <a href="https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=song&w=%E5%91%A8%E6%9D%B0%E4%BC%A6">周杰伦</a></h6>
                                        <span><i class="fa fa-calendar"></i>24/4/2014</span> 
                                        <span><i class="fa fa-heart"></i>1,200</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!---- Start Widget ---->
                    <div class="widget ">
                        <div class="heading"><h4>MV欣赏</h4></div>
                        <div class="content">
                            <div class="wrap-vid">
                                <div class="zoom-container">
                                    <div class="zoom-caption">
                                        <span class="vimeo">Soundtrack原声</span>
                                        <a href="https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=song&w=%E5%A4%A9%E5%91%BD%E9%A3%8E%E6%B5%81">
                                            <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
                                        </a>
                                        <p>天命风流</p>
                                    </div>
                                    <img src="images/1.jpg" />
                                </div>
                                <h3 class="vid-name"><a href="https://y.qq.com/n/yqq/mv/v/y0021x5cmmf.html">天峰会八荒</a></h3>
                                <div class="info">
                                    <h5>By <a href="#">腾讯</a></h5>
                                    <span><i class="fa fa-calendar"></i>25/3/2015</span> 
                                    <span><i class="fa fa-heart"></i>1,200</span>
                                </div>
                            </div>
                            <div class="wrap-vid">
                                <div class="zoom-container">
                                    <div class="zoom-caption">
                                        <span class="vimeo">Folk民谣</span>
                                        <a href="https://y.qq.com/n/yqq/album/0038tYHd2nzTYu.html">
                                            <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
                                        </a>
                                        <p>活着</p>
                                    </div>
                                    <img src="images/2.jpg" />
                                </div>
                                <h3 class="vid-name"><a href="https://y.qq.com/n/yqq/song/002fd96B43RdFh.html">活着</a></h3>
                                <div class="info">
                                    <h5>By <a href="#">郝云</a></h5>
                                    <span><i class="fa fa-calendar"></i>25/3/2015</span> 
                                    <span><i class="fa fa-heart"></i>1,200</span>
                                </div>
                            </div>
                            <div class="wrap-vid">
                                <div class="zoom-container">
                                    <div class="zoom-caption">
                                        <span class="vimeo">Pop流行</span>
                                        <a href="https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=song&w=%E5%92%8C%E4%BB%8E%E5%89%8D%E4%B8%80%E6%A0%B7">
                                            <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
                                        </a>
                                        <p>和从前一样</p>
                                    </div>
                                    <img src="images/3.jpg" />
                                </div>
                                <h3 class="vid-name"><a href="https://y.qq.com/n/yqq/song/003TFohf4KxvHq.html">男人花</a></h3>
                                <div class="info">
                                    <h5>By <a href="#">黄勇</a></h5>
                                    <span><i class="fa fa-calendar"></i>25/3/2015</span> 
                                    <span><i class="fa fa-heart"></i>1,200</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php
require('./public/footer.php');